package com.langfeiyes.pattern.builder;

public class App {
    public static void main(String[] args) {
        //可乐流水线
        ColaBuilder colaBuilder = (ColaBuilder) new ColaBuilder()
                .fillDrink("百事可乐")
                .ingredientHandler("水， 糖浆，香精")
                .packing("pepsi");




        ProductionWorkshop pw = new ProductionWorkshop();
        pw.setBuilder(colaBuilder);
        Drink cola = pw.produce();
        System.out.println(cola);


        //果汁流水线
        FruitJuiceBuilder  fruitJuiceBuilder = (FruitJuiceBuilder) new FruitJuiceBuilder()
                .fillDrink("汇源果汁")
                .ingredientHandler("水， 果汁，香精")
                .packing("hiyan");
        pw.setBuilder(fruitJuiceBuilder);
        Drink juice = pw.produce();
        System.out.println(juice);
    }
}
